-- CALC_ROOM_STORATE_BOX_BONUS

-- 计算休息室储物箱的奖励
-- @param user    玩家对象
return function(user)
    local rand1 = DungeonM.getRandSeed("ROOM_STORATE_BOX_BONUS") % 100;
    -- 1、必定获得1~3个【折弯的铜币】（50%、30%、20%）
    local arrAmount = {
        {["amount"] = 2, ["ratio"] = 50},
        {["amount"] = 3, ["ratio"] = 30},
        {["amount"] = 4, ["ratio"] = 20},
    };

    local amount = fetchElemBySeed(arrAmount, rand1)["amount"];
    local ret = { {1, 7028, amount}, };

    local rand2 = DungeonM.getRandSeed("ROOM_STORATE_BOX_BONUS") % 1000;
    -- 2、50%概率：获得【鲜血之瓶 】、【暗影徽章】、【烧焦羊皮卷】、【萨满之耳】其一
    -- 3、30%概率：获得【兽人的肝脏】
    -- 4、20%概率：获得【眼球酊剂】
    local arr = {
        {["class_id"] = 7029, ["ratio"] = 125},
        {["class_id"] = 7030, ["ratio"] = 125},
        {["class_id"] = 7031, ["ratio"] = 125},
        {["class_id"] = 7032, ["ratio"] = 125},
        {["class_id"] = 7112, ["ratio"] = 300},
        {["class_id"] = 7111, ["ratio"] = 200},
    };

    local classId = fetchElemBySeed(arr, rand2)["class_id"];

    table.insert(ret, { 1, classId, 1 });

    return ret;
end
